import request from '@/utils/request'
import Qs from 'qs'

export default {
  /* 文件上传 */
  upload: function(formData){
    return request({
      method: 'POST',
      url: '/sys/upload',
      headers: {
        'Content-Type': 'multipart/form-data',
      },
      data: formData
    })
  },
  /* 获取订单配置 */
  orderSetting: function(id){
    return request({
      method: 'GET',
      url: '/sys/orderSetting'
    })
  },
  /* 获取秒杀商品列表 */
  secKillGoodsList: function({status}){
    return request({
      method: 'GET',
      url: '/secKill/goodsList',
      params: {
        status: status
      }
    })
  },
  /* 获取秒杀商品详情 */
  secKillGoodsDetail: function({goodsId}){
    return request({
      method: 'GET',
      url: '/secKill/goodsDetail',
      params: {
        goodsId: goodsId
      }
    })
  },
  /* 秒杀商品地址 */
  secKillUrl: function(goodsId){
    return request({
      method: 'GET',
      url: '/secKill/secKillUrl/'+goodsId
    })
  },
  /* 秒杀商品 */
  secKill: function(url){
    return request({
      method: 'POST',
      url: url,
    })
  }
}
